<!-- Box -->
<div class="box">


    <!-- Box Head -->
    <div class="box-head">
        <h2 class="left">Listagem  de <?php echo $_SESSION['opcao']; ?></h2>
        <div class="right">
            <label>Pesquisar</label>
            <input type="text" class="field small-field" />
            <input type="submit" class="button" value="Localizar" />
        </div>
    </div>
    <!-- End Box Head -->	

    <?php
    include '../controller/Controller.php';

    $dados = Controller::listar($_SESSION['classe']);
    ?>


    <!-- Table -->
    <div class="table">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <th width="13"><input type="checkbox" class="checkbox" /></th>

                <?php
                foreach ($dados as $linha) {
                    foreach ($linha as $campo => $valor) {
                        echo '<th>' . $campo . '</th>';
                    }
                    break;
                }
                ?>
                <th width="110" class="ac">Ações</th>
            </tr>

            <?php
            foreach ($dados as $linha) {
                echo '  <tr>';
                echo '<td><input type="checkbox" class="checkbox" /></td>';
                foreach ($linha as $campo => $valor) {
                    if (strstr($campo, 'ID_')) {
                        $id = $valor;
                    }
                    echo '<td>' . $valor . '</td>';
                }
                echo '<td>';
                echo '<a href="../controller/Controller.php?id=' . $id . '&op=E" class="ico del">Excluir</a>';
                echo '<a href="../controller/Controller.php?id=' . $id . '&op=A" class="ico edit">Editar</a>';
                echo '</td>';
                echo '</tr>';
            }
            ?>



        </table>
    </div>
    <!-- Table -->

</div>
<!-- End Box -->
